package cn.sll.base.config;

import cn.sll.base.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class LoginConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor) //添加拦截器
                .addPathPatterns("/**") //设置拦截所有
                .excludePathPatterns("/login/**") //设置拦截器放行路径
                .excludePathPatterns("/fastDfs/**") //设置拦截器放行路径
                .excludePathPatterns("/verifyCode/**") //设置拦截器放行路径
                .excludePathPatterns("/shop/settlement/**") //设置拦截器放行路径
                .excludePathPatterns("/shop/activity/**"); //设置拦截器放行路径


    }














}
